package com.study.langchain4j.api;

import com.study.langchain4j.service.BaseSpringBootHelloWorldChatService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xl-9527
 * @since 2025/10/27
 **/
@RestController
@RequestMapping("ai/chat/base/spring-boot")
public class BaseSpringBootHelloWorldChatApi {

    private final BaseSpringBootHelloWorldChatService baseSpringBootHelloWorldChatService;

    public BaseSpringBootHelloWorldChatApi(final BaseSpringBootHelloWorldChatService baseSpringBootHelloWorldChatService) {
        this.baseSpringBootHelloWorldChatService = baseSpringBootHelloWorldChatService;
    }

    @GetMapping("/hello")
    public String hello(@RequestParam("userMessage") String userMessage) {
        return baseSpringBootHelloWorldChatService.hello(
                userMessage
        );
    }
}
